<%@ page import="com.me.mvc.utils.MenuUtils" %>
<%--<%@ page import="com.me.mvc.model.ModelUtils" %>--%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%--
  Created by IntelliJ IDEA.
  User: r.uholnikov
  Date: 14-May-15
  Time: 16:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <%@include file="pieces/header.jsp"%>
  <meta name="description" content="transactions">
</head>
<body>
<div class="container">
  <h1 class="alert-info">Transactions</h1>
<jsp:include page="pieces/mainMenue.jsp" />
    <%=MenuUtils.getMenuHtml("transactions")%>
  <form name="form1" method="get">
  <table border="2">
    <tr>
      <td>id</td>
      <td>sender</td>
      <td>receiver</td>
      <td>sum</td>
      <td>date</td>
    </tr>
    <c:forEach var="transaction" items="${transactions}">
      <tr>
        <td><c:out value="${transaction.id}"/></td>
        <td><a href="/transactions/byClient/<c:out value="${transaction.senderAccount.client.id}"/>"/><c:out value="${transaction.senderAccount.client.name}"/></a></td>
        <td><a href="/transactions/byClient/<c:out value="${transaction.senderAccount.client.id}"/>"/><c:out value="${transaction.receiverAccount.client.name}"/></a></td>
        <td><c:out value="${transaction.sum}"/></td>
        <td><c:out value="${transaction.dateOfTransaction}"/></td>
      </tr>
    </c:forEach>
      <tr>
        <td><input type="text" value="autogenerated id" disabled /></td>
        <td><input type="number" placeholder="sender id" name="sender" /></td>
        <td><input type="number" placeholder="receiver id" name="receiver" /></td>
        <td><input type="text" name="sum" placeholder="enter the sum"/></td>
        <td>current date</td>
      </tr>
    </table>
    <input  type="submit" />
  </form>
</body>
</html>
